﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;

using Sinacor.Infra.Service.Security.Services;
using Sinacor.Servico.Bovespa.Ordens.Service.ServiceContract;

namespace Sinacor.Servico.Bovespa.Ordens.Service.ServiceImplementation
{
    [SinacorServiceBehavior]
    public class LoteDigitacao : ServiceContract.ILoteDigitacao
    {
        #region ILoteMembers
        public bool  Inserir(List<DataContract.Request.InserirLoteDigitacao> pRequest)
        {
            Translator.TranslateLoteDigitacao translator = new Translator.TranslateLoteDigitacao();          
            return new BusinessLogic.LoteDigitacao().Inserir(translator.ToEntity(pRequest)); 
        }

        public List<Service.DataContract.Response.LoteDigitacaoResponse> ConsultarLoteDigitacao(Service.DataContract.Request.ConsultarLoteDigitacaoRequest pRequest)
        {
            Translator.TranslateLoteDigitacao translator = new Translator.TranslateLoteDigitacao();
            return translator.ToResponse(new BusinessLogic.LoteDigitacao().ConsultarLoteDigitacao(translator.ToParameter(pRequest)));
        }

        // WAbreu.7COMm   2008-08-21 09:52   TASK 1289
        public bool Excluir(List<DataContract.Request.ExcluirLoteDigitacao> pListExcluirLoteDigitacao)
        {
            Translator.TranslateLoteDigitacao xl = new Translator.TranslateLoteDigitacao();
            return new BusinessLogic.LoteDigitacao().Excluir(xl.ToParameter(pListExcluirLoteDigitacao)); 
        }


        /// <summary>
        /// Verificar se existe lote digitado para digitação multipla
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns>true or false</returns>
        /// 
        public bool ConsultarLoteDigitacaoMultiplo(List<Service.DataContract.Request.ConsultarLoteDigitacaoRequest> pRequest)
        {
            Translator.TranslateLoteDigitacao xl = new Translator.TranslateLoteDigitacao();
            return new BusinessLogic.LoteDigitacao().ConsultarLoteDigitacaoMultiplo(xl.ToParameter(pRequest));
        }
        #endregion
    }
}

